


Namespace Kardex
Public Class OrdenCompra



 Public Function Combo(ByVal vTodos As Boolean, Optional ByVal vmensaje As String = "Todos") As Entity.Kardex.OrdenCompraCol
dim objCol as  New entity.Kardex.OrdenCompraCol
dim obj as  New Data.Kardex.OrdenCompra
objCol = obj.Listar("", _
		-1, _
		-1, _
		-1, _
		"", _
		-1, _
		0, _
		0.0, _
		0.0, _
		0.0, _
		0.0, _
		"")
 If vTodos Then
Dim ent As New Entity.Kardex.OrdenCompra( _ 
		-1, _
		vmensaje , _
		-1, _
		"", _
		-1, _
		0, _
		0.0, _
		0.0, _
		0.0, _
		0.0, _
		"")
objCol.AddPrimero(ent)
End If
Return objCol
End Function


'***************************


public Function Listar(OrdenCompraId as integer) as Entity.Kardex.OrdenCompra

dim objEnt as  New entity.Kardex.OrdenCompra
dim obj as  New Data.Kardex.OrdenCompra
return obj.Listar(OrdenCompraId)

End Function


'***************************



public Function Listar( _
		OrdenCompraId as Integer, _
		ProveedorId as Integer, _
		TipoDocumento as Integer, _
		NumeroDocumento as String, _
		AlmacenId as Integer, _
		Fecha as Long, _
		SubTotal as Double, _
		IGV_PORCENTAJE as Double, _
		IGV as Double, _
		Total as Double, _
		Descripcion as String) _
as  Entity.Kardex.OrdenCompraCol

dim objCol as  New entity.Kardex.OrdenCompraCol
dim obj as  New Data.Kardex.OrdenCompra
return obj.listar("", _
		OrdenCompraId, _
		ProveedorId, _
		TipoDocumento, _
		NumeroDocumento, _
		AlmacenId, _
		Fecha, _
		SubTotal, _
		IGV_PORCENTAJE, _
		IGV, _
		Total, _
		Descripcion)

End Function


'***************************


public Function Grabar( _
		OrdenCompraId as Integer, _
		ProveedorId as Integer, _
		TipoDocumento as Integer, _
		NumeroDocumento as String, _
		AlmacenId as Integer, _
		Fecha as Long, _
		SubTotal as Double, _
		IGV_PORCENTAJE as Double, _
		IGV as Double, _
		Total as Double, _
		Descripcion as String, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.OrdenCompra
 if OrdenCompraId=-1 then 
_codigo= obj.insert( "", _
		OrdenCompraId , _
		ProveedorId , _
		TipoDocumento , _
		NumeroDocumento , _
		AlmacenId , _
		Fecha , _
		SubTotal , _
		IGV_PORCENTAJE , _
		IGV , _
		Total , _
		Descripcion , _
 vUSuario )
else
_codigo= obj.update( "", _
		OrdenCompraId , _
		ProveedorId , _
		TipoDocumento , _
		NumeroDocumento , _
		AlmacenId , _
		Fecha , _
		SubTotal , _
		IGV_PORCENTAJE , _
		IGV , _
		Total , _
		Descripcion , _
 vUSuario )
end if 
return _codigo

End Function


'***************************


public Function Insertar( _
		OrdenCompraId as Integer, _
		ProveedorId as Integer, _
		TipoDocumento as Integer, _
		NumeroDocumento as String, _
		AlmacenId as Integer, _
		Fecha as Long, _
		SubTotal as Double, _
		IGV_PORCENTAJE as Double, _
		IGV as Double, _
		Total as Double, _
		Descripcion as String, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.OrdenCompra
_codigo= obj.insert( "", _
		OrdenCompraId, _
		ProveedorId, _
		TipoDocumento, _
		NumeroDocumento, _
		AlmacenId, _
		Fecha, _
		SubTotal, _
		IGV_PORCENTAJE, _
		IGV, _
		Total, _
		Descripcion, _
 vUSuario )
return _codigo

End Function


'***************************


public Function Updatear( _
		OrdenCompraId as Integer, _
		ProveedorId as Integer, _
		TipoDocumento as Integer, _
		NumeroDocumento as String, _
		AlmacenId as Integer, _
		Fecha as Long, _
		SubTotal as Double, _
		IGV_PORCENTAJE as Double, _
		IGV as Double, _
		Total as Double, _
		Descripcion as String, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.OrdenCompra
_codigo= obj.Update( "", _
		OrdenCompraId , _
		ProveedorId , _
		TipoDocumento , _
		NumeroDocumento , _
		AlmacenId , _
		Fecha , _
		SubTotal , _
		IGV_PORCENTAJE , _
		IGV , _
		Total , _
		Descripcion , _
 vUSuario )
return _codigo

End Function


'***************************


public Function ELiminar(  OrdenCompraId as integer,vusuario as integer ,optional vopcion as string="Delete") as integer
dim _codigo as integer =-1
dim obj as  New Data.Kardex.OrdenCompra
_codigo= obj.Eliminar( "vopcion", OrdenCompraId ,vusuario)
return _codigo

End Function

End Class



end namespace

